package com.bobi.tfca.model.vo;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateTime;
import com.bobi.tfca.model.entity.ActivityEntity;
import com.bobi.tfca.model.entity.ArticleEntity;
import com.bobi.tfca.model.entity.ParagraphEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 李文发
 * @date 2024/4/13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "活动")
public class ActivityVO implements Serializable {

    @Serial
    private static final long serialVersionUID = -1960556764589565294L;
    @ApiModelProperty(value = "活动id")
    // 活动id
    private Integer activityId;
    @ApiModelProperty(value = "活动名称")
    // 活动名称
    private String activityName;
    @ApiModelProperty(value = "活动内容")
    // 活动内容
    private String activityDetails;
    @ApiModelProperty(value = "报名条件")
    // 报名条件
    private String signCondition;
    @ApiModelProperty(value = "报名开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    // 报名开始时间
    private LocalDateTime signStartTime;
    @ApiModelProperty(value = "报名结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    // 报名结束时间
    private LocalDateTime signEndTime;
    @ApiModelProperty(value = "活动开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    // 活动开始时间
    private LocalDateTime actStartTime;
    @ApiModelProperty(value = "活动结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    // 活动结束时间
    private LocalDateTime actEndTime;
    @ApiModelProperty(value = "活动图片")
    // 活动图片
    private String outsidePicture;
    @ApiModelProperty(value = "活动状态（0：待审核，1：未开始，2：进行中，3：已结束，4：已取消）")
    // 活动状态（0：待审核，1：未开始，2：进行中，3：已结束，4：已取消）
    private String activityStatus;
    @ApiModelProperty(value = "限制人数")
    // 限制人数
    private Integer limitedNum;
    @ApiModelProperty(value = "活动地点")
    // 活动地点
    private String activityPlace;
    @ApiModelProperty(value = "发布时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    // 发布时间
    private LocalDateTime publishTime;
    @ApiModelProperty(value = "当前用户角色")
    // 当前用户角色
    private String role;
    @ApiModelProperty(value = "已报人数")
    // 已报人数
    private Integer signedNum;
    @ApiModelProperty(value = "群id")
    private Integer groupId;
    @ApiModelProperty(value = "组织者id")
    private Integer organizerId;

    public static ActivityEntity ofActivityVO(ActivityVO activityVO) {
        ActivityEntity entity = new ActivityEntity();
        entity.setActivityId(null);
        BeanUtil.copyProperties(activityVO, entity);
        return entity;
    }

}
